Generate an exportable and ambient version of the TypeScript types#136
Merged
Generate an exportable and ambient version of the TypeScript types#136
Conversation
0c18f4e to
45fd54a
Compare
6ad28f0 to
5dfe33e
Compare
0c18f4e to
be1df8e
Compare
This was
linked to
issues
Oct 28, 2022
45fd54a to
aad867d
Compare
be1df8e to
30ed347
Compare
30ed347 to
aad867d
Compare
Contributor
Author
|
@mrbbot This should be ready for review now:
|
mrbbot
reviewed
Nov 2, 2022
Contributor
mrbbot
left a comment
There was a problem hiding this comment.
Hey! This looks much better! Added some more comments. Sorry there are a lot, but they're mostly pretty small. I think we should be able to remove the ambient transformer too.
aad867d to
2cc857a
Compare
mrbbot
reviewed
Nov 3, 2022
Contributor
mrbbot
left a comment
There was a problem hiding this comment.
A few more tiny things, but looks good to me! 🙂
2cc857a to
5f1ddca
Compare
mrbbot
reviewed
Nov 3, 2022
46d8716 to
9229a5e
Compare
jasnell
approved these changes
Nov 11, 2022
Collaborator
jasnell
left a comment
There was a problem hiding this comment.
Likely needs a rebase but other LGTM
2ffc8b5 to
f98a4f6
Compare
f98a4f6 to
29b7af0
Compare
penalosa
added a commit
to penalosa/workerd
that referenced
this pull request
Nov 14, 2022
* Generate an exportable and ambient version of the TypeScript types (cloudflare#136) * Generate an exportable and ambient version of the TypeScript types * Update compatibility-date.capnp * Update compatibility-date.capnp * Update package.json * Update node-install.ts * Add binary validation * Penalosa/release to npm (#6) * Update npm.yml * Update node-install.ts * Update package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follows on from @mrbbot's work, by parsing the outputted type definitions along with
lib.webworkerandlib.webworker.d.ts. It does two major things:lib.webworkerto the generated workers types, which gives much better documentation for standard types.api.tswhich contains importable versions of the types. Importantly, they're only importable as types, not as values.The intention here is that it will be possible to type a worker in combination with an ambient
lib.domorlib.webworkerdeclaration, as the ambient declaration will provide global (value) versions ofResponseandfetchetc... These will be slightly different to what's available in the workers runtime, of course, but not significantly so (see Workers/Standards diff for a look at how far off the workers runtime is from standards compliance).api.d.tswhich is the same as the current version of the types—purely ambient declarations.